function BbdLocalsetItem(key, value, exp) {
    if (!exp) {
        exp = 1000 * 60 * 60 * 60
    }
    var currentTime = new Date().getTime();
    localStorage.setItem(key, JSON.stringify({data: value, time: currentTime, exp}))
}

function BbdLocalgetItem(key) {
    var data = localStorage.getItem(key);
    var dataObj = JSON.parse(data);
    if (!dataObj) {
        return ""
    }
    var currentTime = new Date().getTime();
    if (currentTime - dataObj.time > dataObj.exp) {
        return ""
    } else {
        return dataObj.data
    }
}